package cn.wolfcode.web.controller;

import cn.wolfcode.domain.ParticipationHistory;
import cn.wolfcode.domain.Points;
import cn.wolfcode.domain.User;
import cn.wolfcode.redis.RedisKey;
import cn.wolfcode.service.IParticipationHistoryService;
import cn.wolfcode.service.IPointsService;
import cn.wolfcode.service.IUserService;
import cn.wolfcode.util.Constants;
import cn.wolfcode.vo.LoginResponseVo;
import cn.wolfcode.vo.LoginVo;
import cn.wolfcode.vo.PointsTaskStatusVo;
import cn.wolfcode.web.anno.RequireLogin;
import cn.wolfcode.web.result.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * Created by wolfcode-lanxw
 */
@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    private IUserService userService;
    @Autowired
    private StringRedisTemplate redisTemplate;

    @Autowired
    private IParticipationHistoryService participationHistoryService;
    @Autowired
    private IPointsService pointsService;
    @PostMapping("/login")
    public Result login(@RequestBody LoginVo vo){
        LoginResponseVo responseVo = userService.login(vo.getUsername(), vo.getPassword());
        return Result.success(responseVo);
    }
}
